<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<script type="text/javascript" src="${staticPath}/static/ckeditor4.10/ckeditor.js"></script>
<style type="text/css">
p img {
    width: auto;
    height: auto;
    max-width: 100%;
}
</style>
<script type="text/javascript">
    $(function() {
    	$('#noticeAdd_overt').click(function(){
    		if($(this).is(':checked')){
    			$('.notice_right').hide();
    			clearDisp('noticeAdd_revOrgids','noticeAdd_revOrgids_disp');
    			clearDisp('noticeAdd_revUserds','noticeAdd_revUserIds_disp');
    		}else{
    			$('.notice_right').show();
    		}
    		
    	})
        $('#noticeAddForm').form({
            url : '${path}/notice/add',
            onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.success) {
                    showMsg(result.msg);
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');
                    parent.$.modalDialog.handler.dialog('close');
                  } else {
                    var form = $('#noticeAddForm');
                    parent.$.messager.alert('错误', result.msg, 'error');
                }
            }
        });
    });
    CKEDITOR.replace( 'noticeAdd_content',{
    	filebrowserImageUploadUrl: '${ctxPath}/ckeditor/uploadImg',  
            language : 'zh-cn'
    });
</script>
<div class="easyui-layout" data-options="fit:true,border:false" >
    <div data-options="region:'center',border:false" style="overflow-x:hidden;overflow-y: auto;padding: 3px;" >
        <form id="noticeAddForm" method="post">
        <input type="hidden" name="type" value="${type}"/>
            <table class="grid">
			 <tr>
                      <td>标题</td>
                      <td>
                        <input name='title' id='title'  type='text' placeholder='请输入标题' class='easyui-text  span2 easyui-validatebox' data-options="required:true" style="width:80%;height:23px;" >
                     </td>
                      <td>公开</td>
                      <td>
                      <input type="checkbox" name="overt" value="1" checked="checked" id="noticeAdd_overt"/>是
                     </td>
                  </tr>
                      <tr class="notice_right" style="display: none">
                     <td>接收部门</td>
                      <td colspan="3">
                       <input type='hidden' name='revOrgids' id='noticeAdd_revOrgids'>
                         <textarea name='revOrgNames' id='noticeAdd_revOrgids_disp' style='border-radius:5px;min-height:50px;min-width:300px;' class='easyui-text'></textarea>
                         <a href="javascript:void(0)" class="easyui-linkbutton" onclick="selectOrg(true,'noticeAdd_revOrgids','noticeAdd_revOrgids_disp')">选择</a>
                         <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearDisp('noticeAdd_revOrgids','noticeAdd_revOrgids_disp')">清除</a>
                     </td>
                     </tr>
                    <tr class="notice_right" style="display: none">
                      <td>接收人</td>
                      <td colspan="3">
                       <input type='hidden' name='revUserids' id='noticeAdd_revUserIds'>
                      <textarea name='revUserNames' id='noticeAdd_revUserIds_disp' style='border-radius:5px;min-height:50px;min-width:300px;' class='easyui-text'></textarea>
                      <a href="javascript:void(0)" class="easyui-linkbutton" onclick="selectUser(true,'noticeAdd_revUserds','noticeAdd_revUserIds_disp')">选择</a>
                         <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearDisp('noticeAdd_revUserIds','noticeAdd_revUserIds_disp')">清除</a>
                     </td>
                  </tr> <tr>
                     <td>内容</td>
                      <td colspan="3">
                     
                     <textarea name='content' id='noticeAdd_content' rows="10" cols="80"></textarea> 
                     </td>
                  </tr> <tr>
                     <td>附件</td>
                      <td colspan="3">
	                    <input name='attachIds' id="noticeAdd_attachId"  type="hidden"/>
	                       <div id="noticeAdd_attachId_disp"></div>
	                      	<a onclick="attachUpload('noticeAdd_attachId','noticeAdd_attachId_disp');" href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:true,iconCls:'fi-plus icon-green'">增加附件</a>
	                    </td>	
                    </tr>
            </table>
        </form>
    </div>
</div>